package es.efor.ics.gev.dao.jpa;

import java.util.List;

import org.springframework.stereotype.Repository;

import es.efor.ics.gev.dao.TipoAtributoDao;
import es.efor.ics.gev.model.TipoAtributo;

/**
 * This class interacts with EntityManager to save/delete and retrieve
 * TipoAtributo objects.
 * 
 * @author dlisbona
 * 
 */
@Repository("tipoAtributoDao")
public class TipoAtributoDaoJpa extends GenericDaoJpa<TipoAtributo, Long>
		implements TipoAtributoDao {

	/**
	 * Constructor that sets the entity to TipoAtributo.class.
	 */
	public TipoAtributoDaoJpa() {
		super(TipoAtributo.class);
	}

	/**
	 * {@inheritDoc}
	 */
	@SuppressWarnings("unchecked")
	public List<TipoAtributo> getTiposAtributo() {
		return getEntityManager().createQuery(
				"select t from TipoAtributo t order by upper(t.nombreTipo)")
				.getResultList();
	}

}
